home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / ASM-MIPS / SIGNAL.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  6KB  |  173 lines

  1. /* $Id: signal.h,v 1.4 1998/08/18 20:46:42 ralf Exp $
  2.  *
  3.  * This file is subject to the terms and conditions of the GNU General Public
  4.  * License.  See the file "COPYING" in the main directory of this archive
  5.  * for more details.
  6.  *
  7.  * Copyright (C) 1995, 1996, 1997, 1998 by Ralf Baechle
  8.  */
  9. #ifndef __ASM_MIPS_SIGNAL_H
  10. #define __ASM_MIPS_SIGNAL_H
  11.  
  12. #include <linux/types.h>
  13.  
  14. #define _NSIG        128
  15. #define _NSIG_BPW    32
  16. #define _NSIG_WORDS    (_NSIG / _NSIG_BPW)
  17.  
  18. typedef struct {
  19.     unsigned long sig[_NSIG_WORDS];
  20. } sigset_t;
  21.  
  22. typedef unsigned long old_sigset_t;        /* at least 32 bits */
  23.  
  24. #define SIGHUP         1    /* Hangup (POSIX).  */
  25. #define SIGINT         2    /* Interrupt (ANSI).  */
  26. #define SIGQUIT         3    /* Quit (POSIX).  */
  27. #define SIGILL         4    /* Illegal instruction (ANSI).  */
  28. #define SIGTRAP         5    /* Trace trap (POSIX).  */
  29. #define SIGIOT         6    /* IOT trap (4.2 BSD).  */
  30. #define SIGABRT         SIGIOT    /* Abort (ANSI).  */
  31. #define SIGEMT         7
  32. #define SIGFPE         8    /* Floating-point exception (ANSI).  */
  33. #define SIGKILL         9    /* Kill, unblockable (POSIX).  */
  34. #define SIGBUS        10    /* BUS error (4.2 BSD).  */
  35. #define SIGSEGV        11    /* Segmentation violation (ANSI).  */
  36. #define SIGSYS        12
  37. #define SIGPIPE        13    /* Broken pipe (POSIX).  */
  38. #define SIGALRM        14    /* Alarm clock (POSIX).  */
  39. #define SIGTERM        15    /* Termination (ANSI).  */
  40. #define SIGUSR1        16    /* User-defined signal 1 (POSIX).  */
  41. #define SIGUSR2        17    /* User-defined signal 2 (POSIX).  */
  42. #define SIGCHLD        18    /* Child status has changed (POSIX).  */
  43. #define SIGCLD        SIGCHLD    /* Same as SIGCHLD (System V).  */
  44. #define SIGPWR        19    /* Power failure restart (System V).  */
  45. #define SIGWINCH    20    /* Window size change (4.3 BSD, Sun).  */
  46. #define SIGURG        21    /* Urgent condition on socket (4.2 BSD).  */
  47. #define SIGIO        22    /* I/O now possible (4.2 BSD).  */
  48. #define SIGPOLL        SIGIO    /* Pollable event occurred (System V).  */
  49. #define SIGSTOP        23    /* Stop, unblockable (POSIX).  */
  50. #define SIGTSTP        24    /* Keyboard stop (POSIX).  */
  51. #define SIGCONT        25    /* Continue (POSIX).  */
  52. #define SIGTTIN        26    /* Background read from tty (POSIX).  */
  53. #define SIGTTOU        27    /* Background write to tty (POSIX).  */
  54. #define SIGVTALRM    28    /* Virtual alarm clock (4.2 BSD).  */
  55. #define SIGPROF        29    /* Profiling alarm clock (4.2 BSD).  */
  56. #define SIGXCPU        30    /* CPU limit exceeded (4.2 BSD).  */
  57. #define SIGXFSZ        31    /* File size limit exceeded (4.2 BSD).  */
  58.  
  59. /* These should not be considered constants from userland.  */
  60. #define SIGRTMIN    32
  61. #define SIGRTMAX    (_NSIG-1)
  62.  
  63. /*
  64.  * SA_FLAGS values:
  65.  *
  66.  * SA_ONSTACK indicates that a registered stack_t will be used.
  67.  * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
  68.  * SA_RESTART flag to get restarting signals (which were the default long ago)
  69.  * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
  70.  * SA_RESETHAND clears the handler when the signal is delivered.
  71.  * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
  72.  * SA_NODEFER prevents the current signal from being masked in the handler.
  73.  *
  74.  * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
  75.  * Unix names RESETHAND and NODEFER respectively.
  76.  */
  77. #define SA_STACK    0x00000001
  78. #define SA_RESETHAND    0x00000002
  79. #define SA_RESTART    0x00000004
  80. #define SA_SIGINFO    0x00000008
  81. #define SA_NODEFER    0x00000010
  82. #define SA_NOCLDWAIT    0x00010000    /* Not supported yet */
  83. #define SA_NOCLDSTOP    0x00020000
  84.  
  85. #define SA_NOMASK    SA_NODEFER
  86. #define SA_ONESHOT    SA_RESETHAND
  87.  
  88. /* 
  89.  * sigaltstack controls
  90.  */
  91. #define SS_ONSTACK     1
  92. #define SS_DISABLE     2
  93.  
  94. #define MINSIGSTKSZ    2048
  95. #define SIGSTKSZ       8192
  96.  
  97. #ifdef __KERNEL__
  98. /*
  99.  * These values of sa_flags are used only by the kernel as part of the
  100.  * irq handling routines.
  101.  *
  102.  * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
  103.  * SA_RESTART flag to get restarting signals (which were the default long ago)
  104.  * SA_SHIRQ flag is for shared interrupt support on PCI and EISA.
  105.  */
  106. #define SA_INTERRUPT        0x01000000    /* interrupt handling */
  107. #define SA_SHIRQ        0x08000000
  108. #define SA_PROBE        SA_ONESHOT
  109. #define SA_SAMPLE_RANDOM    SA_RESTART
  110. #endif /* __KERNEL__ */
  111.  
  112. #define SIG_BLOCK    1    /* for blocking signals */
  113. #define SIG_UNBLOCK    2    /* for unblocking signals */
  114. #define SIG_SETMASK    3    /* for setting the signal mask */
  115. #define SIG_SETMASK32    256    /* Goodie from SGI for BSD compatibility:
  116.                    set only the low 32 bit of the sigset.  */
  117.  
  118. /* Type of a signal handler.  */
  119. typedef void (*__sighandler_t)(int);
  120.  
  121. /* Fake signal functions */
  122. #define SIG_DFL    ((__sighandler_t)0)    /* default signal handling */
  123. #define SIG_IGN    ((__sighandler_t)1)    /* ignore signal */
  124. #define SIG_ERR    ((__sighandler_t)-1)    /* error return from signal */
  125.  
  126. struct sigaction {
  127.     unsigned int    sa_flags;
  128.     __sighandler_t    sa_handler;
  129.     sigset_t    sa_mask;
  130.     int        sa_resv[2];    /* reserved */
  131. };
  132.  
  133. /* XXX use sa_rev for storing ka_restorer */
  134. struct k_sigaction {
  135.     struct sigaction sa;
  136.     void (*ka_restorer)(void);
  137. };
  138.  
  139. /* IRIX compatible stack_t  */
  140. typedef struct sigaltstack {
  141.     void *ss_sp;
  142.     size_t ss_size;
  143.     int ss_flags;
  144. } stack_t;
  145.  
  146. #ifdef __KERNEL__
  147. #include <asm/sigcontext.h>
  148. #endif
  149.  
  150. #if defined (__KERNEL__) || defined (__USE_MISC)
  151. /*
  152.  * The following break codes are or were in use for specific purposes in
  153.  * other MIPS operating systems.  Linux/MIPS doesn't use all of them.  The
  154.  * unused ones are here as placeholders; we might encounter them in
  155.  * non-Linux/MIPS object files or make use of them in the future.
  156.  */
  157. #define BRK_USERBP    0    /* User bp (used by debuggers) */
  158. #define BRK_KERNELBP    1    /* Break in the kernel */
  159. #define BRK_ABORT    2    /* Sometimes used by abort(3) to SIGIOT */
  160. #define BRK_BD_TAKEN    3    /* For bd slot emulation - not implemented */
  161. #define BRK_BD_NOTTAKEN    4    /* For bd slot emulation - not implemented */
  162. #define BRK_SSTEPBP    5    /* User bp (used by debuggers) */
  163. #define BRK_OVERFLOW    6    /* Overflow check */
  164. #define BRK_DIVZERO    7    /* Divide by zero check */
  165. #define BRK_RANGE    8    /* Range error check */
  166. #define BRK_STACKOVERFLOW 9    /* For Ada stackchecking */
  167. #define BRK_NORLD    10    /* No rld found - not used by Linux/MIPS */
  168. #define _BRK_THREADBP    11    /* For threads, user bp (used by debuggers) */
  169. #define BRK_MULOVF    1023    /* Multiply overflow */
  170. #endif /* defined (__KERNEL__) || defined (__USE_MISC) */
  171.  
  172. #endif /* !defined (__ASM_MIPS_SIGNAL_H) */
  173.